package day1.TraversalBinaryTree;

/**
 * @author pacai
 * @version 1.0
 * 求出二叉树的最大高度
 */
public class MaxInumDepthOfBinaryTree {
    public static class TreeNode<T>{
         T data;
         TreeNode<T> left;
         TreeNode<T> right;
    }

    public static int maxDepth(TreeNode root){
        if(root  == null) return 0;
        return Math.max(maxDepth(root.left),maxDepth(root.right)) + 1;
    }
}
